package org.huawei260.OD260;

import java.util.Arrays;
import java.util.Scanner;
public class O0004_猴子爬山DP2 { // 55%

//	public class Main {
		static int[] cache = new int[51];

		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();

			Arrays.fill(cache, -1);
			cache[0] = 0;
			cache[1] = 1;
			cache[2] = 1;
			cache[3] = 2;

			System.out.println(recursive(n));
		}

		public static int recursive(int n) {
			if (cache[n] != -1) return cache[n];
			cache[n] = recursive(n - 1) + recursive(n - 3);
			return cache[n];
		}
	}